VBA stands for Visual Basic for Applications. The examples were developed and tested in various Excel versions between Excel 2007 and Excel 2016, but are saved in Excel 2003 format for compatibility.
- ReadAndDisplayMultipleValues.xls: Reads multiple OPC Classic item values, and stores them in cells of a worksheet.
- ReadAndDisplayValue.xls: The simplest Excel VBA example for OPC “Classic”. Reads an OPC item value and stores it in a cell of a worksheet.
- ReadAndWriteValue.xls: Shows how to read or write an OPC Classic item value upon press of a button.
- SubscribeToMultipleItems.xls: Show how to subscribe to and unsubscribe from multiple OPC Classic items, and how to continuously update the worksheet cells with their values.
- UAClientCertificateParameters.xls: Sets the application name for the client certificate.
- UACallMethodNoArguments.xlsm: Shows how to call OPC UA methods that have no arguments. Shows how to disable or enable OPC UA condition.
- UADataDialog.xls: Shows how a user can interactively select an OPC-UA endpoint and a data node.
- UAReadAndDisplayMultiple.xls: Reads multiple OPC UA nodes, and shows the results in cells of a worksheet.
- UAReadAndDisplayValue.xls: The simplest Excel VBA example for OPC UA. Reads an OPC UA value and stores it in a cell of a worksheet.
- UAReadAndWriteValue.xls: Shows how to read or write an OPC UA value upon press of a button.
- UASubscribeToMultiple.xls: Shows how to subscribe to and unsubscribe from multiple OPC UA monitored items, and how to continuously update the worksheet cells with their values.
- UASubscribeToMultiple2.xls and UASubscribeToMultiple3.xls: As UASubscribeToMultiple.xls, but allows sheet editing while being subscribed, using different approaches. The UASubscribeToMultiple3.xls example also shows hoe to specify an absolute deadband.
Much, if not all, of the functionality presented by these examples is achievable without any programming using the
Excel Connector. You should only consider using VBA if the features provided by the Excel Connector are not sufficient for your application.
VBA Development Specifics
Because VBA is, as a language, nearly identical to VB 6.0, please see the corresponding chapter on VB 6.0 for development specifics in this language.
See Also
Fundamentals
Knowledge Base